import menuactionfactory from './menuactionfactory.js'

class MenuControler {
  constructor(map) {
    this.painter = map;
    this.factory = new menuactionfactory.MenuActionFactory();
    this.preMenu = null;
  }
  act2ClieckMenu(map, menuItem) {
    let rst = null;
    var curentMenu = this.factory.createAction(map, menuItem);
    if (curentMenu) {
      rst = curentMenu.act2Click();
      this.preMenu = curentMenu;
    }
    return rst;
  }

  setPreMenuRelateValue(value){
    let rst = null;
    if (this.preMenu){
      rst = this.preMenu.setPreMenuRelateValue(value);
    }
    return rst;
  }
}

export default { MenuControler }

